Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes I made?
Added a variable in the environment file to specify the admin username. Only users with this specified username can perform admin actions.
![image](https://private-user-images.githubusercontent.com/117223377/384615513-a16fc695-828a-464f-9b49-d05d8c07b3a8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODA5NDcsIm5iZiI6MTczOTI4MDY0NywicGF0aCI6Ii8xMTcyMjMzNzcvMzg0NjE1NTEzLWExNmZjNjk1LTgyOGEtNDY0Zi05YjQ5LWQwNWQ4YzA3YjNhOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxMzMwNDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ODI0ODU4NWRjMDhlY2M3ZGY3ZjFjYmMyOTRhZjQ4ODM0MWIxNGI3NTBlZmQ0M2U0NTA3ZjViMjk3MGMyMDBlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ju8QjnraxDKhRanHqbQD2Osz-oZ4YopsjqUIg6ERhnc)
Moved the login and registration pages out of the admin directory, as these are now accessible to all users, including non-admins.
Introduced a new middleware to verify if the user has admin privileges.
Restricted certain features based on user roles. Tasks like creating posts, editing posts, and accessing the dashboard are hidden from non-admin users.
Preview
2024-11-09.20-22-32.mp4